package com.yanqu.road.entity.player;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_u_mini_bind", desc = "小程序绑定角色信息")
public class UserWechatBind extends DataObject {
    @FieldTypeAnnotation(desc = "用户Id", select = true, update = true)
    private long userId;
    @FieldTypeAnnotation(desc = "最近一次请求绑定码时间戳秒")
    private long lastGetBindTime;
    @FieldTypeAnnotation(desc = "最近n次请求绑定码时间戳秒")
    private List<Long> bindTimeList = new ArrayList<>();
    @FieldTypeAnnotation(desc = "加密后的绑定码")
    private String bindCode ="";
    @FieldTypeAnnotation(desc = "绑定状态")
    private boolean isBind;

    public UserWechatBind() {
    }

    public UserWechatBind(long userId) {
        this.userId = userId;
        setInsertOption();
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public long getLastGetBindTime() {
        return lastGetBindTime;
    }

    public void setLastGetBindTime(long lastGetBindTime) {
        this.lastGetBindTime = lastGetBindTime;
        setUpdateOption();
    }

    public List<Long> getBindTimeList() {
        return bindTimeList;
    }

    public void setBindTimeList(List<Long> bindTimeList) {
        this.bindTimeList = bindTimeList;
        setUpdateOption();
    }

    public void addBindTimeList(long time) {
        this.bindTimeList.add(time);
        setUpdateOption();
    }

    public boolean isBind() {
        return isBind;
    }

    public void setBind(boolean bind) {
        isBind = bind;
        setUpdateOption();
    }

    public String getBindCode() {
        return bindCode;
    }

    public void setBindCode(String bindCode) {
        this.bindCode = bindCode;
        setUpdateOption();
    }
}
